<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="author" content="甘忠祥">
    <title>改变透明度</title>
    <style>
        *{
            box-sizing: border-box;
        }
        ul,li{
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .container{
            width: 850px;
            margin: 100px auto;
        }
        .content{
            width: 850px;
            height: 430px;
            border: 2px solid black;
            border-radius: 10px;
        }
        img{
            width: 200px;
            height: 200px;
            opacity: 0.2;
            border-radius: 10px;
        }
        .img-list li{
            width: 200px;
            float: left;
            margin: 5px;
        }
        .img-list li img:hover{
             box-shadow: 0 0 5px black; 
            opacity: 1;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="content">
            <ul class="img-list">
                <li><img src="img/1.jpg" alt=""></li>
                <li><img src="img/2.jpg" alt=""></li>
                <li><img src="img/3.jpg" alt=""></li>
                <li><img src="img/4.jpg" alt=""></li>
                <li><img src="img/5.jpg" alt=""></li>
                <li><img src="img/6.jpg" alt=""></li>
                <li><img src="img/7.jpg" alt=""></li>
                <li><img src="img/8.jpg" alt=""></li>
            </ul> 
        </div>
    </div>
</body>

</html>